<script src="jquery.js"></script>
<script src="validate.js"></script>

<script>
	
  var v = {
        name: {
                controlID: "#txt_name",
                message: "name is required"
        		},
		email: {
                controlID: "#txt_email",
                message: "Email Address is Required, Please enter valid email.",
                command: function () {
                    var cntrl = $(this.controlID).val().trim();
                    var r = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
                    return r.test(cntrl);
                				}
				
	      },
		BilltoZip: {
            controlID: "#txt_zip",
            message: "Zip should be between 4 & 12 characters",
            minlength: 4,
            maxlength: 12
	
	      }
	
	}



	$().ready(function() {
	
		$("#btn_sbt").click(function() {
			var m = ajxValidator(v).validator();
			if(m) alert("all good, Lets submit");
		})
		
	})
</script>

Name: <input type="text" id="txt_name" /><br />
Email: <input type="text" id="txt_email" /><br />
Zip: <input type="text" id="txt_zip" /><br />

<input type="button" value="Submit" id="btn_sbt" />